home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
Exception.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-04-27
|
699b
|
31 lines
#ifndef Exception_First
#ifdef __GNUG__
//pragma once
#pragma interface
#endif
#define Exception_First
#include <setjmp.h>
typedef struct {
jmp_buf buf;
} ExceptionContext;
#define TRY { ExceptionContext *__old= gException, __curr; \
int __code; \
gException= &__curr; \
if ((__code= setjmp(gException->buf)) == 0) {
#define CATCH(n) gException= __old; \
} else { \
int n= __code; \
gException= __old;
#define ENDTRY } }
extern ExceptionContext *gException;
extern void throw(int code);
#endif